package com.wxy.controller;



import java.security.Principal;


//import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import jakarta.servlet.http.HttpServletRequest;

@Controller
public class myController {
	@RequestMapping("test1")
	public String test1() {
		return "hello";
	}
	@RequestMapping("test2")
	@ResponseBody
	public String test2() {
		return "hello";
	}
//	@RequestMapping("/getLoginUser")			
//	@ResponseBody
//	public Principal getPrincipal(Principal principal) {
//		return principal;
//	}
//	@RequestMapping("getLoginUser2")
//	@ResponseBody
//	public Principal getPrincipal(Authentication authentication) {
//		return authentication;
//	}
	@RequestMapping("login")
	@ResponseBody
	public void test3(HttpServletRequest request) throws Exception {
		request.setCharacterEncoding("utf-8");
		String username=request.getParameter("username");
		String password=request.getParameter("password");
		System.out.println(username+" "+password);
	}
	@RequestMapping("logout")
	@ResponseBody
	public void test4() {
		
	}
}
